<!DOCTYPE html>
<html>
<head>
<title>部门管理</title>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="Author" content="larry" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="../../statics/common/cascader/cascader/cascader.css" media="all">
<link rel="stylesheet" type="text/css" href="../../statics/common/layui/css/layui.css" media="all">
<link rel="stylesheet" type="text/css" href="../../statics/common/layui/css/autocomplete.css">
<link rel="stylesheet" type="text/css" href="../../statics/common/layui/css/soulTable.css">
<link rel="stylesheet" type="text/css" href="../../statics/plugins/ztree/css/metroStyle/metroStyle.css">
<link rel="stylesheet" type="text/css" href="../../statics/css/common.css">
<link rel="stylesheet" type="text/css" href="../../statics/css/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../../statics/css/list-search-table.css">
<!--<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/layui-soul-table/docs/soulTable.css" media="all"/>-->
<script type="text/javascript" src="../../statics/plugins/jquery.min.js"></script>
<script type="text/javascript" src="../../statics/common/lib/vue.min.js"></script>
<script type="text/javascript" src="../../statics/plugins/ztree/jquery.ztree.all.min.js"></script>
<script type="text/javascript" src="../../statics/common/layui/layui.all.js"></script>
<script type="text/javascript" src="../../statics/common/js/axios.min.js"></script>
<script type="text/javascript" src="../../statics/common/js/xm-select.js"></script>
<script type="text/javascript" src="../../statics/js/common.js"></script>
<script type="text/javascript" src="../../statics/js/upload.js"></script>
<script type="text/javascript" src="../../statics/common/step/steps.js"></script>
<link rel="stylesheet" href="../../statics/css/jxcPublicAll.css"  media="all">
<link href="../../statics/common/photoviewer/dist/photoviewer.css" rel="stylesheet">
<link rel="stylesheet" href="../../statics/common/step/steps.css">
<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.7/cropper.css" media="all">-->
<link rel="stylesheet" href="../../statics/js/modules/cropper/cropper.css" media="all">
<link rel="stylesheet" type="text/css" href="../../statics/css/viewer.min.css">
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.7/cropper.min.js"></script>-->
<script src="../../statics/js/modules/cropper/cropper.min.js"></script>
<script src="../../statics/common/photoviewer/dist/photoviewer.js"></script>
<script src="../../statics/common/layui/autocomplete.js"></script>
<script  src="../../statics/js/modules/viewer/viewer.min.js"></script>
<script src="../../statics/common/print-js/print.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../statics/common/print-js/print.min.css">
<script type="text/javascript" src="../../statics/common/xmselect/xm-select.js"></script>
<script type="text/javascript" src="../../statics/js/searchview.js"></script>
<script type="text/javascript" src="../../statics/js/tableedit.js"></script>
<script type="text/javascript" src="../../statics/common/base64/base64.js"></script>

<!--<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.0&type=webgl&ak=eo4XeZhRKHsQ0NOe6u6NkKscmRsk416B"></script>-->

<!-- 引入组件库 -->
<link rel="stylesheet" type="text/css" href="../../statics/css/index.css">






    <style>
        .layui-form-label {
            padding: 5px 0px !important;
            width: 140px !important;
        }
        .layui-input-block {
            margin-left: 170px;
            min-height: 36px;
            width: 300px;
        }
        .layui-input-block1 {
            margin-left: 110px;
            min-height: 36px;
            width: 100%;
        }
        .layui-form-checkbox {
            position: relative;
            height: 30px;
            line-height: 30px;
            margin-right: 10px;
            padding-right: 30px;
            margin-top: 10px;
            cursor: pointer;
            font-size: 0;
            -webkit-transition: .1s linear;
            transition: .1s linear;
            box-sizing: border-box;
        }

    </style>
</head>
<body class="ren-body">
<div id="rrapp" v-cloak>
    <blockquote class="layui-elem-quote quoteBox">
        <form class="layui-form">
            <div class="card">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="form-update-content-box-text">
                            部门管理主要是用来标记员工所属部门，划分员工权限等
                        </div>
                    </div>

                </div>
            </div>
        </form>
    </blockquote>

    <div class="list-search-title-box">
        <form class="layui-form">
            <div style="display:flex;width: 100%;">
                <div class="layui-form-item layui-row" style="width: 100%;">
                    <div class="list-search-form-button" style="width: 100%;">
                        <mperm v-m-perm="['sys:dept:save']">
                                <a class="layui-btn search-btn" @click="add">新增</a>
                        </mperm>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <table class="layui-hide" id="grid" lay-filter="grid"></table>

    <div v-show="showForm" class="layui-form ren-form" id="editForm">
        <div  class="jxc-detail layui-form ren-form" >
            <section class="jxc-section">
                <legend class="aTitle">基本信息</legend>
                <hr class="layui-bg-gray">
                <div class="card">
                    <!-- 业务修改，增加显示条件 -->
                    <div class="layui-row form-group" v-show="sysDept.addType != 3">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label"><span style="color:red">*</span>上级机构名称</label>
                            <div class="layui-input-block">
                                <input v-show="sysDept.addType != 2" readonly="readonly" @click="selectParentWarning" type="text" lay-verify="required" v-model="sysDept.parentName" autocomplete="off" placeholder="请选择上级机构" class="layui-input">
                                <input v-show="sysDept.addType == 2" readonly="readonly" type="text" lay-verify="required" v-model="sysDept.parentName" autocomplete="off" placeholder="请选择上级机构" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label"><span style="color:red">*</span>组织机构名称</label>
                            <div class="layui-input-block">
                                <input type="text" lay-verify="required" v-model="sysDept.name"  @input="changeDeptNameInput()" autocomplete="off" placeholder="请输入组织机构名称" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label"><span style="color:red">*</span>组织机构类型</label>
                            <div class="layui-input-block">
                                <select name="sysDeptType" lay-filter="sysDeptType"  v-model="sysDept.sysDeptType">
                                    <option value="">请选部门类型</option>
                                    <option value=1 :disabled="disabledOption1">总公司</option>
                                    <!--<option value=2 :disabled="disabledOption2">中心</option>-->
                                    <option value=3 :disabled="disabledOption3">分公司</option>
                                    <option value=4 :disabled="disabledOption4">子公司</option>
                                    <option value=5>部门</option>
                                    <!--<option value=6 >卫星城</option>-->
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">显示排序</label>
                            <div class="layui-input-block">
                                <input type="number" lay-verify="required" v-model="sysDept.orderNum" autocomplete="off" placeholder="请输入显示排序" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">状态</label>
                            <div class="layui-input-block">
                                <input type="radio" name="sysDeptStatus" lay-verify="sysDeptStatus" lay-filter="sysDeptStatus" value="1" title="正常" v-model="sysDept.sysDeptStatus">
                                <input type="radio" name="sysDeptStatus" lay-verify="sysDeptStatus" lay-filter="sysDeptStatus" value="2" title="停用" v-model="sysDept.sysDeptStatus">
                            </div>
                        </div>
                    </div>
                </div>

                <legend class="aTitle">
                    仓库/城市信息
                    <span><i  @mouseout.stop="mouseout" @mousemove="move(5)"  class="layui-icon layui-icon-about" style="color: #f56c6c;margin-left: 20px;" :id="5"></i></span>
                </legend>
                <hr class="layui-bg-gray">
                <div class="card">
                    <div class="layui-row form-group" v-show="sysDept.showAssociatedWarehouse">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">是否需要关联仓库/城市</label>
                            <div class="layui-input-block">
                                <input type="radio" v-model="sysDept.createWarehouseFlag"  name="createWarehouseFlag"  lay-filter="createWarehouseFlagFilter" value="1" checked title="是" >
                                <input type="radio" v-model="sysDept.createWarehouseFlag"   name="createWarehouseFlag"  lay-filter="createWarehouseFlagFilter" value="2" title="否">                                </div>
                        </div>
                    </div>
                    <div class="layui-row form-group" v-show="sysDept.showCreateWarehouseNameFlag == '1'">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label" style="width: 150px;">创建仓库关联名</label>
                            <div class="layui-input-block">
                                <input type="text" lay-verify="createWarehouseName" v-model="sysDept.createWarehouseName" maxlength="40" autocomplete="off" placeholder="创建仓库关联名" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">关联仓库/城市</label>
                            <div style="padding-left: 170px;">
                                <input v-for ="warehouse in warehouseList" name="warehouse" type="checkbox" :checked="warehouse.checked"  :value="warehouse.warehouseId" lay-filter="warehouseFilter" :title="warehouse.warehouseName" style="padding-bottom: 5px;" />
                            </div>
                        </div>
                    </div>
                </div>

                <legend class="aTitle">月租账单计算方式</legend>
                <hr class="layui-bg-gray">
                <div class="card">
                        <div class="layui-row form-group">
                            <div class="column layui-col-xs12">
                            <label class="layui-form-label">账单类型</label>
                            <div style="padding-left: 170px;">
                                <input type="radio" name="sysDeptOrder" lay-verify="sysDeptOrder" lay-filter="sysDeptOrder" value=1 title="自然月计算" v-model="sysDept.billType">
                                <span><i  @mouseout.stop="mouseout" @mousemove="move(1)"  class="layui-icon layui-icon-about" style="color: #f56c6c;margin-left: -20px;" :id="1"></i></span>
                                <input type="radio" name="sysDeptOrder" lay-verify="sysDeptOrder" lay-filter="sysDeptOrder" value=2 title="自然月计算（具体时间可以配置）" v-model="sysDept.billType">
                                <span><i  @mouseout.stop="mouseout" @mousemove="move(2)"  class="layui-icon layui-icon-about" style="color: #f56c6c;margin-left: -20px;" :id="2"></i></span>
                                <input type="radio" name="sysDeptOrder" lay-verify="sysDeptOrder" lay-filter="sysDeptOrder" value=3 title="固定30日" v-model="sysDept.billType">
                                <span><i  @mouseout.stop="mouseout" @mousemove="move(3)"  class="layui-icon layui-icon-about" style="color: #f56c6c;margin-left: -20px;" :id="3"></i></span>
                                <input type="radio" name="sysDeptOrder" lay-verify="sysDeptOrder" lay-filter="sysDeptOrder" value=4 title="满月计算" v-model="sysDept.billType">
                                <span><i  @mouseout.stop="mouseout" @mousemove="move(4)"  class="layui-icon layui-icon-about" style="color: #f56c6c;margin-left: -20px;" :id="4"></i></span>
                            </div>
                        </div>
                    </div>
                </div>

                <legend class="aTitle" v-show="showCompany">公司/门店-信息</legend>
                <hr class="layui-bg-gray" v-show="showCompany">
                <div class="card" v-show="showCompany">
<!--                    <legend class="aTitle" v-if="showCompany1">公司信息</legend>-->
<!--                    <hr class="layui-bg-gray" v-if="showCompany1">-->
<!--                    <div class="card" v-if="showCompany1">-->
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">公司名称</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.companyName" autocomplete="off" placeholder="请输入公司名称" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">法定代表人</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.legalPerson" autocomplete="off" placeholder="请输入法定代表人" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">统一社会信用代码</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.uscCode" autocomplete="off" placeholder="请输入统一社会信用代码" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">联系地址</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.contactAddress" autocomplete="off" placeholder="请输入联系地址" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">联系人</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.contactName" autocomplete="off" placeholder="请输入联系人" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">联系邮箱</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.contactEmail" autocomplete="off" placeholder="请输入联系邮箱" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">联系电话</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50"  v-model="sysDept.contactTel" autocomplete="off" placeholder="请输入联系电话" class="layui-input">
                            </div>
                        </div>
                    </div>


                    <!-- 展示地图 获取经纬度-->
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">经纬度</label>
                            <div class="layui-input-block">
                                <input type="text"  v-model="sysDept.lonlat" autocomplete="off" placeholder="获取经纬度" class="layui-input" readonly>
                                <a class="layui-btn search-btn" @click="getBaiduData">获取经纬度</a>
                            </div>
                        </div>
                    </div>
                </div>

                <legend class="aTitle">财务信息</legend>
                <hr class="layui-bg-gray">
                <div class="card">
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">商户号</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.financialCode" autocomplete="off" placeholder="请输入商户号" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">APPID</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.financialAppId" autocomplete="off" placeholder="请输入APPID" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">密钥</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.financialSecretNo" autocomplete="off" placeholder="请输入密钥" class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>

                <legend class="aTitle">服务支持设置</legend>
                <hr class="layui-bg-gray">
                <div class="card">
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">小程序服务热线</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.miniPhone" autocomplete="off" placeholder="请输入小程序服务热线" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">业务线索处理人</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.miniHandleUser" autocomplete="off" placeholder="请输入业务线索处理人" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">手机号</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.miniMobile" autocomplete="off" placeholder="请输入手机号" class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
                <legend class="aTitle">小程序二维码</legend>
                <hr class="layui-bg-gray">
                <div class="card">
                    <div class="layui-row form-group">
                            <div class="layui-input-inline-upload" v-show="sysDept.wxQrcode != null">
                                <div  class="layui-input-inline-upload-show box-rect">
                                    <div  class="layui-input-inline-upload-button">
                                        <img :src="imageURL + sysDept.wxQrcode" class="view-img">
                                    </div>
                                    <div>
                                        <div style="width: 49%;" @click="downDoc(sysDept.name+'二维码.jpeg',sysDept.wxQrcode)" class="layui-input-inline-upload-show-delete btn-event">下载</div>
                                        <div style="width: 50%;margin-left:51%;" @click="showDoc(sysDept.name+'二维码',sysDept.wxQrcode)" class="layui-input-inline-upload-show-delete btn-event">预览</div>
                                    </div>
                                </div>
                            </div>
                    </div>
                </div>

                <legend class="aTitle">违章账号</legend>
                <hr class="layui-bg-gray">
                <div class="card">
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">违章查询账号</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.survielUn" autocomplete="off" placeholder="请输入小程序服务热线" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">密码</label>
                            <div class="layui-input-block">
                                <input type="text" maxlength="50" v-model="sysDept.survielPw" autocomplete="off" placeholder="请输入业务线索处理人" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row form-group">
                        <div class="column layui-col-xs12">
                            <label class="layui-form-label">地址</label>
                            <div class="layui-input-block">
                                <select ay-search="" id="survielAd" name="survielAd" lay-filter="survielAd"
                                        v-model="sysDept.survielAd">
                                    <option value="">请选择</option>
                                    <option v-for="(item,index) in addrList" :value="item.addrCode">{{item.addrName}}</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>


    <!--<div v-show="showForm" class="layui-form ren-form" id="mapForm">
    <div  class="jxc-detail layui-form ren-form" >
        <section class="jxc-section">
            <legend class="aTitle">地图信息</legend>
            <hr class="layui-bg-gray">
            <div class="card">
                <div id="container"></div>
            </div>
        </section>
    </div>-->
</div>
</div>

<!--操作-->
<script type="text/html" id="barTpl">
    <mperm v-m-perm="['sys:dept:update']">
    <a class="layui-grid-btn-xs" lay-event="add" more-btn-index="{{d.LAY_INDEX-1}}">新增下级</a>
    <a class="layui-grid-btn-xs" lay-event="edit" more-btn-index="{{d.LAY_INDEX-1}}">修改</a>
    <a class="layui-grid-btn-xs" lay-event="del" more-btn-index="{{d.LAY_INDEX-1}}">删除</a>
    <a class="layui-grid-btn-xs" lay-event="top" more-btn-index="{{d.LAY_INDEX-1}}">置顶</a>
    <a class="layui-grid-btn-xs" lay-event="generateWxQrcode" more-btn-index="{{d.LAY_INDEX-1}}">生成小程序二维码</a>
    {{#if(d.sysDeptStatus == 1){}}
    <a class="layui-grid-btn-xs" lay-event="usingChange" more-btn-index="{{d.LAY_INDEX-1}}">停用</a>
    {{# }else{}}
    <a class="layui-grid-btn-xs" lay-event="usingChange" more-btn-index="{{d.LAY_INDEX-1}}">启用</a>
    {{# }}}
    </mperm>
</script>

<script src="../../statics/js/modules/sys/sysdeptnew.js?_${.now?long}"></script>
</body>
</html>
